<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>更改 HTML 元素的内容为字符串</title>
</head>
<body>
    <div id="change" class="change">
    <h1></h1>
    </div>

    <script>
        let element = document.querySelector("#change > h1")
        console.log(element);

        element.textContent = "Hello, World!"
        
    </script>
</body>
</html>